/**
 * Created by Administrator on 2017/3/15 0015.
 */

import Relay from "react-relay";

export default class CreateUserMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { createUser }`;
    }

    getVariables() {
        return {
            argsInput: {
                name: this.props.name,
                phone: this.props.phone,
                password: this.props.password
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on createUserPayload {
            createUser {
                errorCode
                value
                totalResult
                id
                token
                userModelList{
                    phone
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
            fragment on createUserPayload {
            createUser {
                errorCode
                value
                totalResult
                id
                token
                userModelList{
                    phone
                            }
                        }
                }
            `]
        }];
    }

}